package cc.wsyw126.java.mock;

import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.powermock.api.mockito.PowerMockito;

import static org.junit.Assert.*;

/**
 * Created by junpeng.yang on 16/8/20.
 */
public class DemoTest2 {
    @InjectMocks
    private Demo demo;

    @Mock
    private String string = "InjectMock";

    @Before
    public void  init(){
        MockitoAnnotations.initMocks(this);
    }


    /**
     * 不能是：final类型,基本类型，内部类型
     */
    @Test
    public void testShouldFail()
    {
//        Mockito.when(string.toString()).thenReturn("123");
        System.out.println(string);
       // PowerMockito.verify(string, PowerMockito.times(100)).length();
    }


}